 package lobby
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import lobby.events.LobbyEvent;
	import lobby.exchangeddata.TransferItemInfo;
	
	/**
	 * ...
	 * @author Bamboo
	 */
	public class TransferItem extends MovieClip
	{
		public var txtrowNo:TextField;
		public var txtGameSite:TextField;
		public var txtBetNo:TextField;
		public var txtDate:TextField;
		public var txtHostDeposit:TextField;
		public var txtHostWithdraw:TextField;
		public var txtHostBalance:TextField;
		public var txtGameSiteDeposit:TextField;
		public var txtGameSiteWithdraw:TextField;
		public var txtGameSiteBalance:TextField;
		
		//public var btnGetDetail:MovieClip;
		
		public function TransferItem(value:TransferItemInfo)
		{
			//trace("value.getTransactionNo : " + value.getTransactionNo);
			//if (value.getTransactionNo != "")
			//{
				this.txtrowNo.text = value.getRow;
				this.txtGameSite.text = value.getGameSite;
				this.txtBetNo.text = value.getBet;
				this.txtDate.text = value.getDate;
				this.txtHostDeposit.text = value.getHostDeposit;
				this.txtHostWithdraw.text = value.getHostWithdraw;
				this.txtHostBalance.text = value.getHostBalance;
				this.txtGameSiteDeposit.text = value.getGameSiteDeposit;
				this.txtGameSiteWithdraw.text = value.getGameSiteWithdraw;
				this.txtGameSiteBalance.text = value.getGameSiteBalance;
			//}
			/*btnGetDetail.visible = odd;
			btnGetDetail.buttonMode = odd;
			btnGetDetail.addEventListener(MouseEvent.CLICK, hldClick);
			if (odd)
			{
				colorFormat(this.txtTransactionIdTf, 0x009900);
			}
			else
			{
				
				colorFormat(this.txtTransactionIdTf, 0xFFFFFF);
			}*/
		}
		
		/*private function hldClick(e:MouseEvent):void
		{
			var evt:LobbyEvent = new LobbyEvent(LobbyEvent.GET_TRANSACTION_DETAIL, true);
			evt.ms = txtTransactionIdTf.text;
			dispatchEvent(evt);
		}*/
		
		private function formatAmount(value:String, txtTf:TextField, color:uint):void
		{
			var amount:Number = Number(value);
			if (amount < 0)
			{
				colorFormat(txtTf, color);
			}
		}
		
		private function colorFormat(txtTf:TextField, color:uint):void
		{
			var format:TextFormat = new TextFormat();
			format.color = color;
			txtTf.setTextFormat(format);
		
		}
	}

}